package com.huawei.xme.ch02.t13;

/**
 * @author 黄后林
 * @date 2022-10-28 16:23:47
 * @note 程序员是用代码喂出来的
 *
 * 思路很重要
 */
public class Task03 {


    public static void main(String[] args) {

        int money =15000;

        double sum =0;

        // 58000 -83000
        if(money>83000 ){
            //超过83000交的税
            money = money -83000;
            sum = sum+ money*0.45;

            //58000要交多少钱
            sum = sum +1500*0.05 + 3000*0.1 + 4500*0.2+26000*0.25+20000*0.3+25000*0.35;
            return;
        }


        // 58000 -83000
        if(money>58000 && money<=83000){
            //超过58000交的税
            money = money -58000;
            sum = sum+ money*0.35;

            //38000要交多少钱
            sum = sum +1500*0.05 + 3000*0.1 + 4500*0.2+26000*0.25+20000*0.3;
            return;
        }

        // 38000 -58000
        if(money>38000 && money<=58000){
            money = money -38000;
            sum = sum+ money*0.3;
            System.out.println(sum);
            sum = sum +1500*0.05 + 3000*0.1 + 4500*0.2+26000*0.25;
            return;
        }

        // 12000 -38000
        if(money>12000 && money<=38000){
            money = money -12000;
            sum = sum+ money*0.25;
            System.out.println(sum);
            sum = sum +1500*0.05 + 3000*0.1 + 4500*0.2;
            return;
        }


        // 7500 -12000
        if(money>7500 && money<=12000){
            money = money -7500;
            sum = sum+ money*0.2;
            System.out.println(sum);
            sum = sum +1500*0.05 + 3000*0.1;
            return;
        }


        // 4500 -7500
        if(money>4500 && money<=7500){
            money = money -4500;
            sum = sum+ money*0.1;
            sum = 1500*0.05+sum ;
            System.out.println(sum);
            return;
        }

        // 3000 -4500
        if(money>3000 && money<=4500){
            money = money -3000;
            sum = sum+ money*0.05;
            System.out.println(sum);
        }

        if(money<=3000){
            System.out.println(sum);
        }




    }
}
